﻿using System;
using System.Data;
using System.Collections.Generic;

namespace DMZS.BLL
{
    /// <summary>
    /// InStock
    /// </summary>
    public partial class InStock : Dlyndx
    {
        private readonly DMZS.DAL.InStock dal = new DMZS.DAL.InStock();
        public InStock()
        {
        }

        /// <summary>
        /// 获取条码
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public DataTable GetBarcode(long ID, DMZS.Model.DlyndxOrder.OrderType OrderType)
        {
            DMZS.BLL.Vchtype bllVchtype=  new DMZS.BLL.Vchtype();
            int vchtype = bllVchtype.GetOrderTypeID(OrderType);
            if (vchtype == 0) return null;

            return dal.GetBarcode(ID, vchtype);
        }
        /// <summary>
        /// 添加行
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public long AddExpand(DMZS.Model.InStock model)
        {
            return dal.AddExpand(model);
        }

        public long UpdateExpand(DMZS.Model.InStock model)
        {
            return dal.UpdateExpand(model);
        }

        public DataSet GetListForDialog(string code, int status, int date)
        {
            return dal.GetListForDialog(code, status, date);
        }

        public int DeleteExpand(long ID, int OrderTypeID)
        {
            return dal.DeleteExpand(ID, OrderTypeID);
        }

        public int Check(long ID, string checke, int OrderTypeID)
        {
            return dal.Check(ID, checke, OrderTypeID);
        }

        public int UnCheck(long ID, int OrderTypeID)
        {
            return dal.UnCheck(ID, OrderTypeID);
        }

        public int Close(long ID, int OrderTypeID)
        {
            return dal.Close(ID, OrderTypeID);
        }

        /// <summary>
        /// 获取表头
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public DataRow GetHead(long ID)
        {
            return dal.GetHead(ID);
        }

        /// <summary>
        /// 获取表体
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public virtual DataTable GetBody(long ID)
        {
            return dal.GetBody(ID);
        }
    }
}

